package com.kingtone.rongji.biz;

public class ProductProperty implements Comparable{

	private String poductId;
	
	private String propertyValue;
	
	private String userInput;
	
	private String productUserInputOrValue;
	
	public ProductProperty(String poductId, String productUserInputOrValue) {
		super();
		this.poductId = poductId;
		this.productUserInputOrValue = productUserInputOrValue;
	}
	
	public String getProductUserInputOrValue() {
		return productUserInputOrValue;
	}

	public void setProductUserInputOrValue(String productUserInputOrValue) {
		this.productUserInputOrValue = productUserInputOrValue;
	}

	public String getPoductId() {
		return poductId;
	}
	
	public void setPoductId(String poductId) {
		this.poductId = poductId;
	}
	public String getPropertyValue() {
		return propertyValue;
	}
	public void setPropertyValue(String propertyValue) {
		this.propertyValue = propertyValue;
	}

	public String getUserInput() {
		return userInput;
	}

	public void setUserInput(String userInput) {
		this.userInput = userInput;
	}

	@Override
	public String toString() {
		return "ProductProperty [poductId=" + poductId + ", productUserInputOrValue="
				+ productUserInputOrValue + "]";
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((productUserInputOrValue == null) ? 0 : productUserInputOrValue.hashCode());
		return result;
	}
	
	@Override
	public int compareTo(Object obj)
    {
		ProductProperty pp = (ProductProperty)obj;
        return this.productUserInputOrValue.compareTo(pp.productUserInputOrValue);
    }
 

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		ProductProperty other = (ProductProperty) obj;
		if (productUserInputOrValue == null) {
			if (other.productUserInputOrValue != null)
				return false;
		} else if (!productUserInputOrValue.equals(other.productUserInputOrValue))
			return false;
		return true;
	}
	
}
